package com.ygo.feihua.console;

import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import com.ygo.feihua.task.*;
import android.os.*;


public class TaskConsole {
	private static final TaskConsole taskConsole=new TaskConsole();
	
	private TaskConsole(){
		
	}
	
	private ExecutorService service = Executors.newSingleThreadExecutor();

	public void addTask(final Task task, final int number) {
		service.execute(new Runnable() {
				@Override
				public void run() {			
					try
					{
						Thread.sleep(100);
					}
					catch (InterruptedException e)
					{}
					task.execute(number);
				}
			});
	}
	
	public static TaskConsole getDx(){
		return taskConsole;
	}
	
}
